package com.content.service.impl;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.content.mapper.ArticleClassMapper;
import com.content.mapperExtend.ArticleClassExtend;
import com.content.mapperExtend.ArticleExtend;
import com.content.mapperExtend.belongToExtend;
import com.content.pojo.Article;
import com.content.pojo.ArticleClass;
import com.content.pojo.ArticleClassExample;
import com.content.pojo.BelongtoKey;
import com.content.pojo.User;
import com.content.service.ArticleClassService;
@Service("ArticleClass")
@Transactional
public class ArticleClassServiceImpl implements ArticleClassService {

	@Resource
	public ArticleClassExtend aClassExtend;

	@Resource
	public ArticleExtend articleExtend;
	
	@Resource
	public belongToExtend bToExtend;
	
	@Override
	public void addArticleClassByAdmin(ArticleClass aClass) {
		// TODO Auto-generated method stub
		Date timeDate = new Date();
		
		SimpleDateFormat sFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		String time = sFormat.format(timeDate);
		aClass.setCreateTime(time);
	}

	@Override
	public List<ArticleClassExample> getAllClasses() {
		// TODO Auto-generated method stub
		return aClassExtend.getAllClasses();
	}

	



	@Override
	public List<User> getAllUser() {
		// TODO Auto-generated method stub
		return aClassExtend.getAllUser();
	}

	@Override
	public void deleteClass(String class_id) {
		// TODO Auto-generated method stub
		aClassExtend.deleteClass(class_id);
	}

	@Override
	public void deleteArticle(String article_id) {
		// TODO Auto-generated method stub
		articleExtend.deleteArticle(article_id);
	}

	@Override
	public void passCheck(BelongtoKey belongtoKey) {
		// TODO Auto-generated method stub
		aClassExtend.passCheck(belongtoKey);
	}

	@Override
	public Article getArticleById(String articleId) {
		// TODO Auto-generated method stub
		return aClassExtend.getArticleById(articleId);
	}

	
	
}
